package course.d1217;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Scanner;

public class date02 {
    public static void main(String[] args) throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个日期(格式：yyyy.MM.dd)");
        String next = scanner.next();
        System.out.println("请输入保质期");
        int day = scanner.nextInt();
        Date date = sdf.parse(next);
        long time = date.getTime();
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.add(Calendar.DATE, day);
        calendar.add(Calendar.WEEK_OF_MONTH,-2);
        calendar.set(Calendar.DAY_OF_WEEK,4);
        System.out.println(calendar.get(Calendar.YEAR)+"年"+(calendar.get(Calendar.MONTH)+1)+"月"+calendar.get(Calendar.DATE));


    }
}
